﻿using Common;
using SqliteDataAccess;
using SqliteDataAccess.SqliteDataManagerTableAdapters;
using System;
using System.Collections.Generic;
using System.Text;

namespace MVP
{
    public class BkuEntryFormPresenter : BasePresenter<IBkuEntryFormView>
    {
        private IBkuEntryFormView _view;

        public BkuEntryFormPresenter(IBkuEntryFormView view)
            : base(view)
        {
            _view = view;
        }

        public void Initialize()
        {
            _view.PosRekeningList = GetUraianPenggunaan();
            _view.JenisPajakList = GetUraianPajak();
        }

        protected override void OnViewInitialize(object sender, EventArgs e)
        {
            base.OnViewInitialize(sender, e);
            Initialize();
        }

        public SqliteDataManager.UraianPenggunaanDataTable GetUraianPenggunaan()
        {
            UraianPenggunaanTableAdapter ta = new UraianPenggunaanTableAdapter();
            return ta.GetDataByTipe((int)TipePosRekening.NonPajak);
        }

        public SqliteDataManager.UraianPenggunaanDataTable GetUraianPajak()
        {
            UraianPenggunaanTableAdapter ta = new UraianPenggunaanTableAdapter();
            return ta.GetDataByTipe((int)TipePosRekening.Pajak);
        }

    }
}
